unit Core_Types;

interface
uses
  Windows, Forms;

const
  ST_INTEGER  = 0; // Integer
  ST_STRING   = 1; // String

type
  TSortType = (byName,bySize, byType, byDate);

  PFile = ^TFile;
  TFile = packed record
    Name      : String;
    Ext       : String;
    Dir       : Boolean;
    Size      : Cardinal;
    Time      : Integer;
    Selected  : Boolean;
  end;

  PFileArray = ^TFileArray;
  TFileArray = packed record
    Path  : String;
    Mask  : String;
    Files : array of TFile;
  end;

  PProgrammInterface = ^TProgrammInterface;
  TProgrammInterface = packed record

  end;

  PPluginInterface = ^TPluginInterface;
  TPluginInterface = packed record
    hLib      : THandle;
    Name      : Array[0..64] of Char;
    ViewExt   : function (Ext : PChar): Boolean;
    EditExt   : function (Ext : PChar): Boolean;
    ViewFile  : function (FileName : PChar) : Integer;
    EditFile  : function (FileName : PChar) : Integer;
    Unload    : procedure;
  end;

  PAppInterface = ^TAppInterface;
  TAppInterface = packed record
    _Application      : TApplication;
    GetVersion        : function : DWord;
    ConsolePrint      : procedure (Msg : PChar); stdcall;
    CO_GetSizeString  : function  (Bytes : Cardinal) : PChar;
    SE_SaveSetting    : procedure (Path : PChar; DataLength : Integer; Data : Pointer); stdcall;
    SE_GetStringVal   : function  (Path : PChar; Default : PChar = nil):PChar;
    SE_GetIntVal      : function  (Path : PChar; Default : Integer = 0):Integer;
    UI_ListPath       : procedure (Path, Mask : PChar; PList : PFileArray); stdcall;
    UI_GetActiveList  : function : PFileArray;
    UI_AddMenuItem    : function  (cCaption: PChar; ProcID : Integer): Boolean;
    UI_UpdateLists    : procedure;
    PE_RegisterProc   : function  (ProcAddr : Pointer):Integer;
  end;

  PListContext = ^TListContext;
  TListContext = packed record
    Protocol  : PChar;
    Path      : PChar;
    SubDir    : Boolean;
    Files     : PFile;
  end;

implementation

end.
